<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<c:set var="context"
	value="${pageContext.request.servletContext.contextPath}" />
<script>

</script>
<!-- Template for all sub-pages -->
<div id="portal_main_content" align="left">
	<!-- Don't change this -->
	<div id="site_title">

		<!-- ************** -->
		<!-- Able to change -->
		<h2>${test.testAndQuizzName}:Feedback</h2>
		<h6 id="testId" class="hidden">${test.testAndQuizzID}</h6>
	</div>
	<!-- Don't change this -->
	<div id="site_content">
		<div id="btn_control">

			<!-- ************** -->
			<!-- Able to change -->
			<a href="../" class="btn btn-primary btn-sm">Back</a>
		</div>
		<div id="main_content">

			<!-- ************** -->
			<!-- Able to change -->

			<c:forEach var="part" items="${test.listPart}">
				<div class="question_part">
					<div class="part_name">
						<ul>
							<li><h6 class="partId hidden">
									<c:out value="${part.testPartId}"></c:out>
								</h6>
								<h3 class="partNum">Part:</h3>
								<h3 class="partName">${part.testPartName}</h3>
							<li class="pull-right"><a href="#" class="partRemove"><span
									class="nav-text"></span></a></li>
						</ul>
					</div>
					<div class="part_content">
						<c:forEach var="question" items="${part.listQuestion}">
							<c:choose>
								<c:when test="${question.type == 1}">
									<div class="question">
										<div class="question_number">
											<ul>
												<li><h6 class="questionId hidden">${question.questionId}</h6>
													<h5 class="questionNum">Question 2:</h5></li>
												<li class="pull-right"><c:if
															test="${question.correct == true}">${question.point}</c:if>
														<c:if test="${question.correct == false}">0.0 </c:if>/${question.point} Point</a></li>
											</ul>
										</div>
										<div class="question_name">${question.question}</div>

										<div class="question_answer">
											<c:choose>
												<c:when test="${question.rightAnswer == 'A'}">
													<div>
														<input type="radio" checked disabled>A. True
													</div>
													<div>
														<input type="radio" disabled>B. False
													</div>
												</c:when>
												<c:when test="${question.rightAnswer == 'B'}">
													<div>
														<input type="radio" disabled>A. True
													</div>
													<div>
														<input type="radio" checked disabled>B. False
													</div>
												</c:when>
												<c:otherwise>
													<div>
														<input type="radio" disabled>A. True
													</div>
													<div>
														<input type="radio" disabled>B. False
													</div>
												</c:otherwise>
											</c:choose>
										</div>
									</div>
								</c:when>
								<c:when test="${question.type == 2}">
									<div class="question">
										<div class="question_number">
											<ul>
												<li><h6 class="questionId hidden">${question.questionId}</h6>
													<h5 class="questionNum">Question 2:</h5></li>
												<li class="pull-right"><c:if
															test="${question.correct == true}">${question.point}</c:if>
														<c:if test="${question.correct == false}">0.0 </c:if>/${question.point} Point</a></li>
											</ul>
										</div>
										<div class="question_name">${question.question}</div>

										<div class="question_answer">
											<div>
												<input type="radio"
													<c:if test="${question.rightAnswer == 'A'}">checked</c:if>
													disabled>A. ${question.answers[0]}
											</div>
											<div>
												<input type="radio"
													<c:if test="${question.rightAnswer == 'B'}">checked</c:if>
													disabled>B. ${question.answers[1]}
											</div>
											<div>
												<input type="radio"
													<c:if test="${question.rightAnswer == 'C'}">checked</c:if>
													disabled>C. ${question.answers[2]}
											</div>
											<div>
												<input type="radio"
													<c:if test="${question.rightAnswer == 'D'}">checked</c:if>
													disabled>D. ${question.answers[3]}
											</div>
										</div>
									</div>
								</c:when>
								<c:when test="${question.type == 3}">
									<div class="question">
										<div class="question_number">
											<ul>
												<li><h6 class="questionId hidden">${question.questionId}</h6>
													<h5 class="questionNum">Question 2:</h5></li>
												<li class="pull-right"><c:if
															test="${question.correct == true}">${question.point}</c:if>
														<c:if test="${question.correct == false}">0.0 </c:if>/${question.point} Point</a></li>
											</ul>
										</div>
										<div class="question_name">${question.question}</div>

										<div class="question_answer">
											<div>
												<input type="checkbox"
													<c:if test="${fn:contains(question.rightAnswer, 'A')}">checked</c:if>
													disabled>A. ${question.answers[0]}
											</div>
											<div>
												<input type="checkbox"
													<c:if test="${fn:contains(question.rightAnswer, 'B')}">checked</c:if>
													disabled>B. ${question.answers[1]}
											</div>
											<div>
												<input type="checkbox"
													<c:if test="${fn:contains(question.rightAnswer, 'C')}">checked</c:if>
													disabled>C. ${question.answers[2]}
											</div>
											<div>
												<input type="checkbox"
													<c:if test="${fn:contains(question.rightAnswer, 'D')}">checked</c:if>
													disabled>D. ${question.answers[3]}
											</div>
										</div>
									</div>
								</c:when>
							</c:choose>
						</c:forEach>
					</div>
				</div>
			</c:forEach>
		</div>
		<div id="table">

			<!-- ************** -->
			<!-- Able to change -->
		</div>

	</div>
</div>

